\(\int \frac {\cos ^4(c+d x) \cot (c+d x)}{(a+b \sin (c+d x))^2} \, dx\) [1229]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 27, antiderivative size = 120 \[ \int \frac {\cos ^4(c+d x) \cot (c+d x)}{(a+b \sin (c+d x))^2} \, dx=\frac {\log (\sin (c+d x))}{a^2 d}+\frac {\left (a^2-b^2\right ) \left (3 a^2+b^2\right ) \log (a+b \sin (c+d x))}{a^2 b^4 d}-\frac {2 a \sin (c+d x)}{b^3 d}+\frac {\sin ^2(c+d x)}{2 b^2 d}+\frac {\left (a^2-b^2\right )^2}{a b^4 d (a+b \sin (c+d x))} \]

[Out]

ln(sin(d*x+c))/a^2/d+(a^2-b^2)*(3*a^2+b^2)*ln(a+b*sin(d*x+c))/a^2/b^4/d-2*a*sin(d*x+c)/b^3/d+1/2*sin(d*x+c)^2/
b^2/d+(a^2-b^2)^2/a/b^4/d/(a+b*sin(d*x+c))

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {2916, 12, 908} \[ \int \frac {\cos ^4(c+d x) \cot (c+d x)}{(a+b \sin (c+d x))^2} \, dx=\frac {\left (a^2-b^2\right )^2}{a b^4 d (a+b \sin (c+d x))}+\frac {\left (3 a^2+b^2\right ) \left (a^2-b^2\right ) \log (a+b \sin (c+d x))}{a^2 b^4 d}+\frac {\log (\sin (c+d x))}{a^2 d}-\frac {2 a \sin (c+d x)}{b^3 d}+\frac {\sin ^2(c+d x)}{2 b^2 d} \]

[In]

Int[(Cos[c + d*x]^4*Cot[c + d*x])/(a + b*Sin[c + d*x])^2,x]

[Out]

Log[Sin[c + d*x]]/(a^2*d) + ((a^2 - b^2)*(3*a^2 + b^2)*Log[a + b*Sin[c + d*x]])/(a^2*b^4*d) - (2*a*Sin[c + d*x
])/(b^3*d) + Sin[c + d*x]^2/(2*b^2*d) + (a^2 - b^2)^2/(a*b^4*d*(a + b*Sin[c + d*x]))

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 908

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && IntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rule 2916

Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)
*(x_)])^(n_.), x_Symbol] :> Dist[1/(b^p*f), Subst[Int[(a + x)^m*(c + (d/b)*x)^n*(b^2 - x^2)^((p - 1)/2), x], x
, b*Sin[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IntegerQ[(p - 1)/2] && NeQ[a^2 - b^2, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {b \left (b^2-x^2\right )^2}{x (a+x)^2} \, dx,x,b \sin (c+d x)\right )}{b^5 d} \\ & = \frac {\text {Subst}\left (\int \frac {\left (b^2-x^2\right )^2}{x (a+x)^2} \, dx,x,b \sin (c+d x)\right )}{b^4 d} \\ & = \frac {\text {Subst}\left (\int \left (-2 a+\frac {b^4}{a^2 x}+x-\frac {\left (a^2-b^2\right )^2}{a (a+x)^2}+\frac {\left (a^2-b^2\right ) \left (3 a^2+b^2\right )}{a^2 (a+x)}\right ) \, dx,x,b \sin (c+d x)\right )}{b^4 d} \\ & = \frac {\log (\sin (c+d x))}{a^2 d}+\frac {\left (a^2-b^2\right ) \left (3 a^2+b^2\right ) \log (a+b \sin (c+d x))}{a^2 b^4 d}-\frac {2 a \sin (c+d x)}{b^3 d}+\frac {\sin ^2(c+d x)}{2 b^2 d}+\frac {\left (a^2-b^2\right )^2}{a b^4 d (a+b \sin (c+d x))} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.35 (sec) , antiderivative size = 111, normalized size of antiderivative = 0.92 \[ \int \frac {\cos ^4(c+d x) \cot (c+d x)}{(a+b \sin (c+d x))^2} \, dx=\frac {\frac {2 \log (\sin (c+d x))}{a^2}+\frac {2 (a-b) (a+b) \left (3 a^2+b^2\right ) \log (a+b \sin (c+d x))}{a^2 b^4}-\frac {4 a \sin (c+d x)}{b^3}+\frac {\sin ^2(c+d x)}{b^2}+\frac {2 \left (a^2-b^2\right )^2}{a b^4 (a+b \sin (c+d x))}}{2 d} \]

[In]

Integrate[(Cos[c + d*x]^4*Cot[c + d*x])/(a + b*Sin[c + d*x])^2,x]

[Out]

((2*Log[Sin[c + d*x]])/a^2 + (2*(a - b)*(a + b)*(3*a^2 + b^2)*Log[a + b*Sin[c + d*x]])/(a^2*b^4) - (4*a*Sin[c
+ d*x])/b^3 + Sin[c + d*x]^2/b^2 + (2*(a^2 - b^2)^2)/(a*b^4*(a + b*Sin[c + d*x])))/(2*d)

Maple [A] (verified)

Time = 0.95 (sec) , antiderivative size = 119, normalized size of antiderivative = 0.99

method result size
derivativedivides \(\frac {-\frac {-\frac {\left (\sin ^{2}\left (d x +c \right )\right ) b}{2}+2 a \sin \left (d x +c \right )}{b^{3}}+\frac {\ln \left (\sin \left (d x +c \right )\right )}{a^{2}}-\frac {-a^{4}+2 a^{2} b^{2}-b^{4}}{a \,b^{4} \left (a +b \sin \left (d x +c \right )\right )}+\frac {\left (3 a^{4}-2 a^{2} b^{2}-b^{4}\right ) \ln \left (a +b \sin \left (d x +c \right )\right )}{b^{4} a^{2}}}{d}\) \(119\)
default \(\frac {-\frac {-\frac {\left (\sin ^{2}\left (d x +c \right )\right ) b}{2}+2 a \sin \left (d x +c \right )}{b^{3}}+\frac {\ln \left (\sin \left (d x +c \right )\right )}{a^{2}}-\frac {-a^{4}+2 a^{2} b^{2}-b^{4}}{a \,b^{4} \left (a +b \sin \left (d x +c \right )\right )}+\frac {\left (3 a^{4}-2 a^{2} b^{2}-b^{4}\right ) \ln \left (a +b \sin \left (d x +c \right )\right )}{b^{4} a^{2}}}{d}\) \(119\)
parallelrisch \(\frac {24 \left (a +b \right ) \left (a +b \sin \left (d x +c \right )\right ) \left (a -b \right ) \left (a^{2}+\frac {b^{2}}{3}\right ) \ln \left (2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+a \left (\sec ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )\right )-24 \left (a +b \sin \left (d x +c \right )\right ) \left (a^{2}-\frac {2 b^{2}}{3}\right ) a^{2} \ln \left (\sec ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (8 b^{5} \sin \left (d x +c \right )+8 a \,b^{4}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+6 a^{3} b^{2} \cos \left (2 d x +2 c \right )-b^{3} a^{2} \sin \left (3 d x +3 c \right )+\left (-24 a^{4} b +19 a^{2} b^{3}-8 b^{5}\right ) \sin \left (d x +c \right )-6 a^{3} b^{2}}{8 b^{4} d \,a^{2} \left (a +b \sin \left (d x +c \right )\right )}\) \(215\)
risch \(-\frac {3 i a^{2} x}{b^{4}}+\frac {2 i x}{b^{2}}-\frac {{\mathrm e}^{2 i \left (d x +c \right )}}{8 b^{2} d}+\frac {i a \,{\mathrm e}^{i \left (d x +c \right )}}{b^{3} d}-\frac {i a \,{\mathrm e}^{-i \left (d x +c \right )}}{b^{3} d}-\frac {{\mathrm e}^{-2 i \left (d x +c \right )}}{8 b^{2} d}-\frac {6 i a^{2} c}{b^{4} d}+\frac {4 i c}{b^{2} d}+\frac {2 \left (a^{4}-2 a^{2} b^{2}+b^{4}\right ) {\mathrm e}^{i \left (d x +c \right )}}{b^{4} d a \left (-i b \,{\mathrm e}^{2 i \left (d x +c \right )}+i b +2 a \,{\mathrm e}^{i \left (d x +c \right )}\right )}+\frac {3 a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1+\frac {2 i a \,{\mathrm e}^{i \left (d x +c \right )}}{b}\right )}{b^{4} d}-\frac {2 \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1+\frac {2 i a \,{\mathrm e}^{i \left (d x +c \right )}}{b}\right )}{b^{2} d}-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1+\frac {2 i a \,{\mathrm e}^{i \left (d x +c \right )}}{b}\right )}{a^{2} d}+\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d \,a^{2}}\) \(311\)
norman \(\frac {-\frac {18 a \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{2} d}-\frac {18 a \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{2} d}-\frac {6 a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{2} d}-\frac {6 a \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{2} d}-\frac {4 \left (9 a^{4}-8 a^{2} b^{2}+3 b^{4}\right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a^{2} b^{3} d}-\frac {4 \left (6 a^{4}-5 a^{2} b^{2}+2 b^{4}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a^{2} b^{3} d}-\frac {4 \left (6 a^{4}-5 a^{2} b^{2}+2 b^{4}\right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a^{2} b^{3} d}-\frac {2 \left (3 a^{4}-2 a^{2} b^{2}+b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a^{2} b^{3} d}-\frac {2 \left (3 a^{4}-2 a^{2} b^{2}+b^{4}\right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a^{2} b^{3} d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4} \left (\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a +2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+a \right )}+\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \,a^{2}}+\frac {\left (3 a^{4}-2 a^{2} b^{2}-b^{4}\right ) \ln \left (\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a +2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+a \right )}{b^{4} a^{2} d}-\frac {\left (3 a^{2}-2 b^{2}\right ) \ln \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{4} d}\) \(434\)

[In]

int(cos(d*x+c)^5*csc(d*x+c)/(a+b*sin(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/d*(-1/b^3*(-1/2*sin(d*x+c)^2*b+2*a*sin(d*x+c))+1/a^2*ln(sin(d*x+c))-(-a^4+2*a^2*b^2-b^4)/a/b^4/(a+b*sin(d*x+
c))+1/b^4*(3*a^4-2*a^2*b^2-b^4)/a^2*ln(a+b*sin(d*x+c)))

Fricas [A] (verification not implemented)

none

Time = 0.41 (sec) , antiderivative size = 189, normalized size of antiderivative = 1.58 \[ \int \frac {\cos ^4(c+d x) \cot (c+d x)}{(a+b \sin (c+d x))^2} \, dx=\frac {6 \, a^{3} b^{2} \cos \left (d x + c\right )^{2} + 4 \, a^{5} - 15 \, a^{3} b^{2} + 4 \, a b^{4} + 4 \, {\left (3 \, a^{5} - 2 \, a^{3} b^{2} - a b^{4} + {\left (3 \, a^{4} b - 2 \, a^{2} b^{3} - b^{5}\right )} \sin \left (d x + c\right )\right )} \log \left (b \sin \left (d x + c\right ) + a\right ) + 4 \, {\left (b^{5} \sin \left (d x + c\right ) + a b^{4}\right )} \log \left (-\frac {1}{2} \, \sin \left (d x + c\right )\right ) - {\left (2 \, a^{2} b^{3} \cos \left (d x + c\right )^{2} + 8 \, a^{4} b - a^{2} b^{3}\right )} \sin \left (d x + c\right )}{4 \, {\left (a^{2} b^{5} d \sin \left (d x + c\right ) + a^{3} b^{4} d\right )}} \]

[In]

integrate(cos(d*x+c)^5*csc(d*x+c)/(a+b*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

1/4*(6*a^3*b^2*cos(d*x + c)^2 + 4*a^5 - 15*a^3*b^2 + 4*a*b^4 + 4*(3*a^5 - 2*a^3*b^2 - a*b^4 + (3*a^4*b - 2*a^2
*b^3 - b^5)*sin(d*x + c))*log(b*sin(d*x + c) + a) + 4*(b^5*sin(d*x + c) + a*b^4)*log(-1/2*sin(d*x + c)) - (2*a
^2*b^3*cos(d*x + c)^2 + 8*a^4*b - a^2*b^3)*sin(d*x + c))/(a^2*b^5*d*sin(d*x + c) + a^3*b^4*d)

Sympy [F(-1)]

Timed out. \[ \int \frac {\cos ^4(c+d x) \cot (c+d x)}{(a+b \sin (c+d x))^2} \, dx=\text {Timed out} \]

[In]

integrate(cos(d*x+c)**5*csc(d*x+c)/(a+b*sin(d*x+c))**2,x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 118, normalized size of antiderivative = 0.98 \[ \int \frac {\cos ^4(c+d x) \cot (c+d x)}{(a+b \sin (c+d x))^2} \, dx=\frac {\frac {2 \, {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )}}{a b^{5} \sin \left (d x + c\right ) + a^{2} b^{4}} + \frac {2 \, \log \left (\sin \left (d x + c\right )\right )}{a^{2}} + \frac {b \sin \left (d x + c\right )^{2} - 4 \, a \sin \left (d x + c\right )}{b^{3}} + \frac {2 \, {\left (3 \, a^{4} - 2 \, a^{2} b^{2} - b^{4}\right )} \log \left (b \sin \left (d x + c\right ) + a\right )}{a^{2} b^{4}}}{2 \, d} \]

[In]

integrate(cos(d*x+c)^5*csc(d*x+c)/(a+b*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

1/2*(2*(a^4 - 2*a^2*b^2 + b^4)/(a*b^5*sin(d*x + c) + a^2*b^4) + 2*log(sin(d*x + c))/a^2 + (b*sin(d*x + c)^2 -
4*a*sin(d*x + c))/b^3 + 2*(3*a^4 - 2*a^2*b^2 - b^4)*log(b*sin(d*x + c) + a)/(a^2*b^4))/d

Giac [A] (verification not implemented)

none

Time = 0.32 (sec) , antiderivative size = 154, normalized size of antiderivative = 1.28 \[ \int \frac {\cos ^4(c+d x) \cot (c+d x)}{(a+b \sin (c+d x))^2} \, dx=\frac {\frac {2 \, \log \left ({\left | \sin \left (d x + c\right ) \right |}\right )}{a^{2}} + \frac {b^{2} \sin \left (d x + c\right )^{2} - 4 \, a b \sin \left (d x + c\right )}{b^{4}} + \frac {2 \, {\left (3 \, a^{4} - 2 \, a^{2} b^{2} - b^{4}\right )} \log \left ({\left | b \sin \left (d x + c\right ) + a \right |}\right )}{a^{2} b^{4}} - \frac {2 \, {\left (3 \, a^{4} b \sin \left (d x + c\right ) - 2 \, a^{2} b^{3} \sin \left (d x + c\right ) - b^{5} \sin \left (d x + c\right ) + 2 \, a^{5} - 2 \, a b^{4}\right )}}{{\left (b \sin \left (d x + c\right ) + a\right )} a^{2} b^{4}}}{2 \, d} \]

[In]

integrate(cos(d*x+c)^5*csc(d*x+c)/(a+b*sin(d*x+c))^2,x, algorithm="giac")

[Out]

1/2*(2*log(abs(sin(d*x + c)))/a^2 + (b^2*sin(d*x + c)^2 - 4*a*b*sin(d*x + c))/b^4 + 2*(3*a^4 - 2*a^2*b^2 - b^4
)*log(abs(b*sin(d*x + c) + a))/(a^2*b^4) - 2*(3*a^4*b*sin(d*x + c) - 2*a^2*b^3*sin(d*x + c) - b^5*sin(d*x + c)
 + 2*a^5 - 2*a*b^4)/((b*sin(d*x + c) + a)*a^2*b^4))/d

Mupad [B] (verification not implemented)

Time = 13.39 (sec) , antiderivative size = 338, normalized size of antiderivative = 2.82 \[ \int \frac {\cos ^4(c+d x) \cot (c+d x)}{(a+b \sin (c+d x))^2} \, dx=\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a^2\,d}-\frac {\frac {6\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{b^2}+\frac {6\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{b^2}+\frac {4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (3\,a^4-3\,a^2\,b^2+b^4\right )}{a^2\,b^3}+\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (3\,a^4-2\,a^2\,b^2+b^4\right )}{a^2\,b^3}+\frac {2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (3\,a^4-2\,a^2\,b^2+b^4\right )}{a^2\,b^3}}{d\,\left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+3\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+4\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+3\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\right )}-\frac {\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )\,\left (3\,a^2-2\,b^2\right )}{b^4\,d}-\frac {\ln \left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\right )\,\left (-3\,a^4+2\,a^2\,b^2+b^4\right )}{a^2\,b^4\,d} \]

[In]

int(cos(c + d*x)^5/(sin(c + d*x)*(a + b*sin(c + d*x))^2),x)

[Out]

log(tan(c/2 + (d*x)/2))/(a^2*d) - ((6*a*tan(c/2 + (d*x)/2)^2)/b^2 + (6*a*tan(c/2 + (d*x)/2)^4)/b^2 + (4*tan(c/
2 + (d*x)/2)^3*(3*a^4 + b^4 - 3*a^2*b^2))/(a^2*b^3) + (2*tan(c/2 + (d*x)/2)^5*(3*a^4 + b^4 - 2*a^2*b^2))/(a^2*
b^3) + (2*tan(c/2 + (d*x)/2)*(3*a^4 + b^4 - 2*a^2*b^2))/(a^2*b^3))/(d*(a + 2*b*tan(c/2 + (d*x)/2) + 3*a*tan(c/
2 + (d*x)/2)^2 + 3*a*tan(c/2 + (d*x)/2)^4 + a*tan(c/2 + (d*x)/2)^6 + 4*b*tan(c/2 + (d*x)/2)^3 + 2*b*tan(c/2 +
(d*x)/2)^5)) - (log(tan(c/2 + (d*x)/2)^2 + 1)*(3*a^2 - 2*b^2))/(b^4*d) - (log(a + 2*b*tan(c/2 + (d*x)/2) + a*t
an(c/2 + (d*x)/2)^2)*(b^4 - 3*a^4 + 2*a^2*b^2))/(a^2*b^4*d)